<template>
  <div class="pagination">
    <el-pagination
      @current-change="handleCurrentChange"
      :current-page.sync="$store.state.userStore.currentPage"
      :page-size="pageNum"
      layout="total, prev, pager, next,jumper"
      :total="totalNum"
    >
    </el-pagination>
  </div>
</template>

<script>
import { mapState, mapActions } from "vuex";
export default {
  name: "pagination",
  data() {
    return {};
  },
  computed: {
    ...mapState("userStore", ["pageNum", "totalNum"]),
  },
  methods: {
    ...mapActions("userStore", ["get_user_list"]),
    handleCurrentChange(val) {
      // console.log("当前页", val);
      this.get_user_list();
    },
  },
};
</script>

<style  scoped>
.pagination {
  margin: 20px;
  text-align: center;
}
</style>
